package vip.xiaonuo.core.scheduled.enums;

import lombok.Getter;

/**
 * @author 墨塵
 * @since 2022/11/30
 */
@Getter
public enum EventEnum {


    SWIPE_CARD("SJ001","门禁刷卡","{0}刷{1}的门禁卡","操作事件",1,0,0),
    SWIPE_CARD_NP("SJ002","门禁卡无权限","{0}无{1}的门禁权限","操作事件",1,1,0),
    SWIPE_CARD_UR("SJ003","门禁卡未登记","{0}的门禁无法识别门禁卡号{1}","操作事件",1,1,0),
    SWIPE_CARD_UNK("SJ004","无法识别门禁卡","{0}的门禁无法识别门禁卡","操作事件",1,1,0),

    DOOR_OPEN("SJ005","开柜门","{0}柜门打开","操作事件",1,0,0),
    DOOR_CLOSE("SJ006","关柜门","{0}柜门关闭","操作事件",1,0,0),

    RET_ITEM_UNK_USER("SJ007","未知用户归还物品","{0}是由未知用户归还,特此提醒!检查时间:{1};检查动作:{2};","预警事件",2,1,1),
    BOR_ITEM_UNK_USER("SJ008","未知用户借用物品","{0}是由未知用户借用,特此提醒!检查时间:{1};检查动作:{2};","预警事件",2,1,1),

    DOOR_OC_NP("SJ009","开关门事件不成对","{0}本次{1}前无对应{2}事件","操作事件",1,1,1),
    DOOR_CLOSE_OT("SJ010","超时未关门","{0}开门后,超过5分钟未关门","提醒事件",1,1,1),
    DOOR_OPEN_NO_USER("SJ011","非用户认证开门","{0}不是通过用户认证开门","提醒事件",1,1,1),

    CAB_RST("SJ012","柜子断电重启","{0}断电后重新启动","提醒事件",1,1,1),

    CAB_INV_MAN("SJ013","手动盘库","{0}对{1}进行盘库;共{2}种物品,在库物品{3}件,离库物品{4}件,维修中物品{5}件,报废物品{6}件;","操作事件",1,0,0),
    CAB_INV_AUTO("SJ014","自动盘库","{0}对{1}进行盘库;共{2}种物品,在库物品{3}件,离库物品{4}件,维修中物品{5}件,报废物品{6}件;","操作事件",1,0,0),

    FIC_ITEM("SJ015","物品首次入柜","{0}首次存入{1},如存放有误,请及时调整;检查时间:{2};检查动作:{3}；操作人:{4};","提醒事件",1,0,1),

    BR_CAB_ABNL("SJ016","取还柜不一致","{0}应存入{1},当前误存入{2},请及时调整;检查时间:{3};检查动作:{4};操作人:{5};","预警事件",2,1,1),
    BR_USER_ABNL("SJ017","取还人不一致","{0}是由{1}借出,由{2}归还,特此提醒;检查时间:{3};检查动作:{4};操作人:{5};","提醒事件",2,1,1),

    OVD_NON_RET("SJ018","物品超期未归还","{0}超期未归还,应{1}前归还,已超期{2}小时;检查时间:{3};检查动作:定期检查","预警事件",2,1,1),
    OVD_RET("SJ019","物品超期归还","{0}超期归还,应{1}前归还,实际{2}归还,超期{3}小时;检查时间:{4};检查动作:关柜门","提醒事件",2,1,1),
    OVD_NEAR("SJ020","物品即将超期","{0}即将超期,应{1}前归还,剩余{2}小时;检查时间:{3};检查动作:定期检查","提醒事件",1,1,1),

    REP_ITEM_LTC("SJ021","维修中物品出柜","目前出柜的{0}目前状态为'维修中',特此提醒,检查时间:{1};检查动作:关柜门;操作人:{2}","提醒事件",null,1,1),
    SCRAP_ITEM_LTC("SJ022","报废物品出柜","目前出柜的{0}目前状态为'已报废',特此提醒,检查时间:{1};检查动作:关柜门;操作人:{2}","提醒事件",null,1,1),
    SCRAP_ITEM_ITC("SJ023","报废物品在柜","{0}目前状态为'已报废',存储在{1},特此提醒,检查时间:{2};检查动作:关柜门;操作人:{3}","提醒事件",null,1,1),
    SCRAP_ITEM_ETC("SJ024","报废物品入柜","{0}目前状态为'已报废',存储在{1},特此提醒,检查时间:{2};检查动作:盘库;","提醒事件",null,1,1),
    UNK_ITEM_ITC("SJ025","未知物品入柜","刚刚入柜物品,未在系统内登记,特提醒到相关人员,检查时间:{0};检查动作:关柜门;操作人:{1}","提醒事件",null,1,1),

    BOR_CHK_INC("SJ026","未完成借用检查","{0}借用人{1}借用检查{2}项未完成;检查时间:{3};检查动作:提交借用检查;操作人:{4};","预警事件",null,1,1),
    RET_CHK_INC("SJ027","未完成归还检查","{0}借用人{1}归还检查{2}项未完成;检查时间:{3};检查动作:提交归还检查;操作人:{4};","预警事件",null,1,1),

    BOR_CHK_UNQ("SJ028","借用检查有不合格项","{0}借用人{1}借用检查合格率为{2};","预警事件",null,0,1),
    RET_CHK_UNQ("SJ029","归还检查有不合格项","{0}借用人{1}归还检查合格率为{2};","预警事件",null,1,1),

    WEBHOOK("SJ030","定期检查-环境事件",null,"环境事件",null,null,null);

    /**
     * 事件编号
     */
    private final String code;

    /**
     * 事件标题
     */
    private final String title;

    /**
     * 事件描述
     */
    private final String description;

    /**
     * 事件类别
     */
    private final String type;

    /**
     * 事件等级
     */
    private final Integer level;

    /**
     * 异常 0-否 1-是
     */
    private final Integer abnlFlag;

    /**
     * 通知 0-否 1-是
     */
    private final Integer notifyFlag;


    EventEnum(String code, String title, String description, String type, Integer level,Integer abnlFlag, Integer notifyFlag) {
        this.code = code;
        this.title = title;
        this.description = description;
        this.type = type;
        this.level = level;
        this.abnlFlag=abnlFlag;
        this.notifyFlag = notifyFlag;
    }
}
